
import { request } from "@/utils/request";

export const uploadImage = async (file: File) => {
  const formData = new FormData();
  formData.append('file', file);
  
  try {
    const response = await request.postUpload('/api/upload', formData);
    
    return response.data;
  } catch (error) {
    console.error('Upload failed:', error);
    throw error;
  }
};